Description:
LNU detects statement labels that are not used.
Incorrect:
function FindItem(list:array of TObject; item:TObject):integer;
var i:integer;
label notFound;
begin
for i := 0 to High(list) do
if list[i].Equals(item) then
begin
result := i;
exit;
end;
notFound:
result := -1;
end;
Correct:
function FindItem(list:array of TObject; item:TObject):integer;
var i:integer;
begin
for i := 0 to High(list) do
if list[i].Equals(item) then
begin
result := i;
exit;
end;
result := -1;
end;